package tpdisenio2009.services;

import java.util.List;
import tpdisenio2009.model.beans.FantasyTeam;
import tpdisenio2009.model.beans.Score;
import tpdisenio2009.model.beans.SoccerPlayer;
import tpdisenio2009.model.beans.TournamentDate;
import tpdisenio2009.model.dao.FantasyTeamDAO;
import tpdisenio2009.model.dao.ScoreDAO;
import tpdisenio2009.model.dao.TournamentDateDAO;
import tpdisenio2009.model.dao.UserDAO;

/**
 *
 * @author Nicolás Kreiff
 */
public class TournamentDatePointsService {

    private final UserDAO userDAO;
    private final TournamentDateDAO dateDAO;
    private final FantasyTeamDAO fantasyTeamDAO;
    private final ScoreDAO scoreDAO;

    public TournamentDatePointsService() {
        userDAO = new UserDAO();
        dateDAO = new TournamentDateDAO();
        fantasyTeamDAO = new FantasyTeamDAO();
        scoreDAO = new ScoreDAO();
    }

    public int countUsers() {
        return userDAO.count();
    }

    /*
    public List<FantasyTeam> getFantasyTeamsByTournamentDate( TournamentDate date, int page ) {
        return fantasyTeamDAO.getFantasyTeamsByTournamentDate( date, page );
    }*/

    public List<TournamentDate> getAssignableDates() {
        return dateDAO.getAssignableDates();
    }

    public List<TournamentDate> getDates() {
        return dateDAO.getAll();
    }

    public Score getScoreByTournamentDate( TournamentDate date, SoccerPlayer player ) {
        return scoreDAO.getScoreByTournamentDate( date, player );
    }

    public void insert(Score score) {
        scoreDAO.insert(score);
    }

    public void update(Score score) {
        scoreDAO.update(score);
    }

}
